import http from '@/utils/axios';
// import { UserInfo, UserListParams } from '@/types/User';

// 获取管理员列表
export const getUserList = (params: any) => {
    return http({
        method: 'get',
        url: '/user/index',
        params,
    });
};

// 获取用户信息
export const getUserInfo = (userId: number) => {
    return http({
        method: 'GET',
        url: `/user/read/${userId}`,
    });
};

// 新增管理员信息
export const saveUserInfo = (data: any) => {
    return http({
        method: 'POST',
        url: `/user/save`,
        data,
    });
};

// 更新用户信息
export const updateUserInfo = (userId: number, data: any) => {
    return http({
        method: 'PUT',
        url: `/user/update/${userId}`,
        data,
    });
};

// 删除用户
export const deleteUser = (userId: number) => {
    return http({
        method: 'DELETE',
        url: `/user/delete/${userId}`,
    });
};